export default [
  {
    name: "login",
    path: "/login",
    component: () => import("@/pages/login"),
  },
  {
    path: '/home',
    component: () => import("@/pages/home"),
    beforeEnter: (to, from, next) => {
      if (true) {
        next();
      } else {
        alert("请先登录，再访问个人主页");
        return { redirect: { path: '/home' } };
      }
    },
    children: [
      {
        name:"meeting",
        path:"/meetingManage/meeting",
        component:()=>import("@/pages/home/meetingManage/meeting")
      },
      {
        name:"meetingRoom",
        path:"/meetingManage/meetingRoom",
        component:()=>import("@/pages/home/meetingManage/meetingRoom")
      },
      {
        name:"personalMeeting",
        path:"/meetingManage/personalMeeting",
        component:()=>import("@/pages/home/meetingManage/personalMeeting")
      },
      {
        name:"draftBox",
        path:"/onlineInfo/draftBox",
        component:()=>import("@/pages/home/onlineInfo/draftBox")
      },
      {
        name:"message",
        path:"/onlineInfo/message",
        component:()=>import("@/pages/home/onlineInfo/message")
      },
      {
        name:"sentMessage",
        path:"/onlineInfo/sentMessage",
        component:()=>import("@/pages/home/onlineInfo/sentMessage")
      },
      {
        name:"unreadMessage",
        path:"/onlineInfo/unreadMessage",
        component:()=>import("@/pages/home/onlineInfo/unreadMessage")
      },
      {
        name:"personalFolder",
        path:"/personalOffice/personalFolder",
        component:()=>import("@/pages/home/personalOffice/personalFolder")
      },
      {
        name:"cardHolder",
        path: "/personalOffice/cardHolder",
        component:()=>import("@/pages/home/personalOffice/cardHolder")
      },
      {
        name:"companyBook",
        path: "/personalOffice/companyBook",
        component:()=>import("@/pages/home/personalOffice/companyBook")
      },
      {
        name:"personalInfo",
        path: "/personalOffice/personalInfo",
        component:()=>import("@/pages/home/personalOffice/personalInfo")
      },
      {
        name:"schedule",
        path: "/personalOffice/schedule",
        component:()=>import("@/pages/home/personalOffice/schedule")
      },
      {
        name:"workArrange",
        path: "/personalOffice/workArrange",
        component:()=>import("@/pages/home/personalOffice/workArrange")
      },
      {
        name:"departmentManage",
        path: "/systemManage/departmentManage",
        component:()=>import("@/pages/home/systemManage/departmentManage")
      },
      {
        name:"roleManage",
        path: "/systemManage/roleManage",
        component:()=>import("@/pages/home/systemManage/roleManage")
      },
      {
        name:"staffManage",
        path: "/systemManage/staffManage",
        component:()=>import("@/pages/home/systemManage/staffManage")
      }

    ],
  },
  {
    path: "/",
    redirect: {
      path: "/login"
    },
  },
]